<?php
/**
 * This file is part from Ewuroweb Shop
 *
 * @package forms
 * @author Ivan I. Atanasov <i.atanasov@viscomp.bg>
 */


class Application_Form_Login extends EW_Form_Base {
    
    
    function _initialize() {   
        // Add an title element
        $this->addElement('text', 'title', array(
            'label'      => 'Title:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array()
        ));
 
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Save',
        ));

        // And finally add some CSRF protection
        $this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));
    }
    //================================================================================
    
	/**
     * Initialize decorators
     */
    protected function _initDecorators() {
        // Element decorators
        $this->setElementDecorators(array(
            array('Label', array('class' => 'text-info')),
            'ViewHelper',
            array('HtmlTag', array('tag' => 'br', 'class' => 'clear')),
            'Errors',
        ));

        // Only ViewHelper for submit button
        $this->getElement('submit')->setDecorators(array('ViewHelper'));

        // Form Decorators
        $this->setDecorators(array(
            'FormElements',
            array('HtmlTag', array('tag' => 'div', 'class' => 'contentColumnLeft')),
            array('Form')
        ));
    }
    //================================================================================
    
    /**
     * @see EW_Form_DbObject::_beforeSave()
     */
    protected function _beforeSave() {
    
    }
    //================================================================================
    
    /**
     * 
     * @see EW_Form_DbObject::_afterSave()
     */
    protected function _afterSave() {
        
    }
    //================================================================================
    
    /**
     * Initialize decorators
     */
    protected function _save() {
        
    }
    //================================================================================
}
